package com.uzai.console.web.mini;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.mini.miniorderservice.*;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.mini.MiniOrderServiceService;
import com.uzai.console.vo.mini.miniorderservice.MiniOrderServiceVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 小程序团购售后管理
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "团购售后",tags = "微信小程序|团购售后")
@ApiSort(7)
@RestController
public class MiniOrderServiceController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(MiniOrderServiceController.class);

    @Autowired
    private MiniOrderServiceService miniOrderServiceService;

    @ApiOperation(value = "分页查询小程序团购售后列表", notes = "分页查询小程序团购售后列表", response = MiniOrderServiceVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/miniOrderService/findByPage")
    public Object fingMiniOrderServiceByPage(@RequestBody MiniOrderServiceQuery miniOrderServiceServiceQuery){
        return miniOrderServiceService.findMiniOrderServiceByPage(miniOrderServiceServiceQuery);
    }

    @ApiOperation(value = "查询小程序团购售后详情", notes = "查询小程序团购售后详情", response = MiniOrderServiceVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/miniOrderService/findById")
    public Object findCmsMerTbOrderList(@RequestBody MiniOrderServiceIdDto miniOrderServiceServiceIdDto){
        return miniOrderServiceService.findMiniOrderServiceById(miniOrderServiceServiceIdDto);
    }

    @SystemLogType(model = SystemModelEnum.MiniOrderService, type = OperationTypeEnum.DELETE)
    @ApiOperation(value = "删除小程序团购售后信息", notes = "删除小程序团购售后信息")
    @ApiOperationSupport(order = 3)
    @PostMapping("/miniOrderService/delete")
    public Object deleteMiniOrderService(@RequestBody MiniOrderServiceIdDto miniOrderServiceServiceIdDto){
        miniOrderServiceService.deleteMiniOrderService(miniOrderServiceServiceIdDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.MiniOrderService, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "小程序团购售后取消(关闭)", notes = "小程序团购售后取消(关闭)")
    @ApiOperationSupport(order = 4)
    @PostMapping("/miniOrderService/cancel")
    public Object cancelMiniOrderService(@RequestBody MiniOrderServiceIdDto miniOrderServiceServiceIdDto){
        miniOrderServiceService.cancelMiniOrderService(miniOrderServiceServiceIdDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.MiniOrderService, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "小程序团购售后拒绝退款", notes = "小程序团购售后拒绝退款")
    @ApiOperationSupport(order = 5)
    @PostMapping("/miniOrderService/rejectRefund")
    public Object rejectRefund(@RequestBody MiniOrderServiceRejectRefundDto miniOrderServiceRejectRefundDto){
        miniOrderServiceService.rejectRefundMiniOrderService(miniOrderServiceRejectRefundDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.MiniOrderService, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "小程序团购售后同意退款", notes = "小程序团购售后同意退款")
    @ApiOperationSupport(order = 6)
    @PostMapping("/miniOrderService/agreeRefund")
    public Object agreeRefund(@RequestBody MiniOrderServiceIdDto miniOrderServiceIdDto){
        miniOrderServiceService.agreeRefundMiniOrderService(miniOrderServiceIdDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.MiniOrderService, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "小程序团购售后拒绝退货退款", notes = "小程序团购售后拒绝退货退款")
    @ApiOperationSupport(order = 7)
    @PostMapping("/miniOrderService/rejectRefundAndGoods")
    public Object rejectRefundAndGoods(@RequestBody MiniOrderServiceRejectRefundAndGoodsDto miniOrderServiceRejectRefundAndGoodsDto){
        miniOrderServiceService.rejectRefundAndGoodsMiniOrderService(miniOrderServiceRejectRefundAndGoodsDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.MiniOrderService, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "小程序团购售后同意退货退款", notes = "小程序团购售后同意退货退款")
    @ApiOperationSupport(order = 8)
    @PostMapping("/miniOrderService/agreeRefundAndGoods")
    public Object agreeRefundAndGoods(@RequestBody MiniOrderServiceIdDto miniOrderServiceIdDto){
        miniOrderServiceService.agreeRefundAndGoodsMiniOrderService(miniOrderServiceIdDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.MiniOrderService, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "小程序团购售后拒绝换货", notes = "小程序团购售后拒绝换货")
    @ApiOperationSupport(order = 9)
    @PostMapping("/miniOrderService/rejectReplace")
    public Object rejectReplace(@RequestBody MiniOrderServiceRejectReplaceDto miniOrderServiceRejectReplaceDto){
        miniOrderServiceService.rejectReplaceMiniOrderService(miniOrderServiceRejectReplaceDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.MiniOrderService, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "小程序团购售后同意换货", notes = "小程序团购售后同意换货")
    @ApiOperationSupport(order = 10)
    @PostMapping("/miniOrderService/agreeReplace")
    public Object agreeReplace(@RequestBody MiniOrderServiceIdDto miniOrderServiceIdDto){
        miniOrderServiceService.agreeReplaceMiniOrderService(miniOrderServiceIdDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.MiniOrderService, type = OperationTypeEnum.UPDATE)
    @ApiOperation(value = "小程序团购售后换货商家发新货", notes = "小程序团购售后换货商家发新货")
    @ApiOperationSupport(order = 10)
    @PostMapping("/miniOrderService/sendNewGoods")
    public Object sendNewGoods(@RequestBody MiniOrderServiceSendNewGoodsDto miniOrderServiceSendNewGoodsDto){
        miniOrderServiceService.sendNewGoodsMiniOrderService(miniOrderServiceSendNewGoodsDto);
        return true;
    }

}
